-
Notifications
You must be signed in to change notification settings - Fork 14
Add return type to improve type coverage #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Is it still relevant? (I know flow also fixed some bugs with coverage reporting). |
afb582e
to
6507227
Compare
@andreypopp sorry for disappearing! It appears to still be relevant. I'm trying to put together a simple reproduction here. I'm running into a problem though with
I'm a little puzzled at the moment and haven't been able to put a lot of cycles towards addressing it yet. I suspect it has to do with a recent version of Flow (currently 0.70.0). I will try downgrading and seeing if I can move forward from there. |
Downgrading to |
Okay I've updated the PR that adds some type coverage that ultimately provides the needed coverage for the test repo to work at full coverage as well. This is ready again for review. |
@@ -28,7 +28,8 @@ export type ValidateResult<V> = { | |||
+value: V, | |||
}; | |||
|
|||
type Refine<A, B> = (value: A, error: (message: GenericMessage) => void) => B; | |||
// Maybe this should be Error instead of mixed? | |||
type Refine<A, B> = (value: A, error: (message: GenericMessage) => mixed) => B; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious what you think here. Error
maybe?
e96d169
to
4a9bd9a
Compare
3cd2942
to
f338de3
Compare
The project I work on has a requirement for 100% type coverage. When making my own custom validators, I noticed properties hanging off
context
weren't something Flow could infer (they becomeany
). Adding this return type is enough for Flow to achieve type coverage with usage ofcontext
.